/**
\page page_object_management Object Management

<table CELLPADDING=0 style="width:100%;
  table-layout:fixed;
	margin:0px 0px 0px 0px;
	border-width:0px 0px 0px 0px; 
	border-color:#7F7F7F;">
<tr> 

<td style="width:80%; padding:0px 5px 0px 0px; vertical-align: text-top; text-align: left">
<h1 style="margin:0px; padding:0px">Overview</h1>

%Qtilities provides an object manager which provides many object management features. The object manager is also responsible to provide a global object pool to the developer. This allows the registration of objects in the global object pool where other objects can access them or the interfaces they implement. This article will provide information on the different features of the object manager and the global object pool.

Table of contents:
- \ref accessing
- \ref features
	- \ref object_pool
	- \ref observer_features
	- \ref meta_type_object_management
	.
- \ref object_property_management
        - \ref object_property_management_working
        - \ref object_property_management_displaying
        .

</td>

<td style="width:20%; vertical-align: top; margin:0px 0px 0px 0px;">
<table style="table-layout:auto;
	margin:0px 0px 0px 0px; 
  width: 100%;
	border-width:0px 0px 0px 0px; 
	border-color:#7F7F7F;
  background-color: #d1d3d4;">
<tr>
<td style="background-color: #5a5c5e; text-align: center">
<h2 style ="color:#FFFFFF">First Steps</h2>
</td>
</tr>
<tr>
<td>
- <a href="page_getting_started.html">Getting Started</a><br>
- <a href="page_the_basics.html">The Basics</a><br>
- <a href="page_examples_and_plugins.html">Examples and Plugins</a><br>
</td>
</tr>
<tr>
<td style="background-color: #5a5c5e; text-align: center">
<h2 style ="color:#FFFFFF">Overviews</h2>
</td>
</tr>
<tr>
<td>
- <a href="page_action_management.html">Action Management</a><br>
- <a href="page_tree_structures.html">Building Trees</a><br>
- <a href="page_debugging.html">Debugging Applications</a><br>
- <a href="page_extension_system.html">Extension System</a><br>
- <a href="page_factories.html">Factories</a><br>
- <a href="page_logging.html">Logging</a><br>
- <a href="page_modules_overview.html">Modules</a><br>
- <a href="page_object_management.html">Object Management</a><br>
- <a href="page_observers.html">Observers</a><br>
- <a href="page_observer_widgets.html">Observer Widgets</a><br>
- <a href="page_project_management.html">Project Management</a><br>
- <a href="page_tasking.html">Tasking</a><br>
- <a href="page_widget_set.html">Widget Set</a><br>
</td>
</tr>
</table>
</td>

</tr>
</table>

\section accessing The Object Manager

The object manager implements the Qtilities::Core::Interfaces::IObjectManager interface and can be accessed directly through the thread safe \p OBJECT_MANAGER macro or directly using Qtilities::Core::QtilitiesCoreApplication::objectManager()

For example:

\code
QObject* my_object = new QObject();
OBJECT_MANAGER->registerObject(my_object);

// Internally the global object pool is an observer which can be accessed like this:
OBJECT_MANAGER->objectPool();
\endcode

\section features Object Management Features

\subsection object_pool The global object pool

A global object pool is a powerful object management feature in an application, especially when the application is extensible through plugins. It allows objects to be registered in the pool and can then be searched and used in other parts of the application. The example below shows some example usages of the global object pool.

\code
#include <IMyIFace.h>

// Register an object in the global object pool
// This will emit the newObjectAdded(QObject*) signal on the object manager
QObject* my_object = new QObject();
OBJECT_MANAGER->registerObject(my_object);

// Check which objects in the global object pool implements a specific interface (called "IMyIFace" in this example)
QList<QObject *> iface_list;
iface_list = OBJECT_MANAGER->registeredInterfaces("IMyIFace");
foreach (QObject* obj, iface_list) {
	IMyIFace* my_iface = qobject_cast<IMyIFace*> (obj);
	if (my_iface) {
		// Now you can access your interface.
	}
}
\endcode

A good example of using the global object pool is the methodology behind how plugins are used in the %Qtilities extension system. Plugins register objects in which the rest of the application might be interested during plugin initialization. Once all plugins were initialized, plugins initializes their dependencies where it will inspect the global object pool for registered objects in which it is interested in.

The Qtilities::Plugins::Debug plugin provides a visual overview of the global object pool state during runtime which simplifies debugging. This is shown in the image below:

\image html debugging_object_pool_tab.jpg "Global Object Pool View In Debug Plugin"

\subsection observer_features Observer object management features

When attaching objects to observers, it is possible to specify the way the object should be managed in the observer context.
The possible management options are defined in the Qtilities::Core::Observer::ObjectOwnership enumeration. See the \ref object_lifetimes section of the \ref page_observers article for more information.

\subsection meta_type_object_management Global object activity management

The object manager provides functionality to manage global active objects in an application. Active objects can be set on a meta-type basis where the meta type is a simple QString used to identify the set of active objects. Active objects for a meta-type can be set using the Qtilities::Core::Interfaces::IObjectManager::setMetaTypeActiveObjects() function. When this function is called the Qtilities::Core::Interfaces::IObjectManager::metaTypeActiveObjectsChanged() signal is emitted with the new set of active objects for the specified meta-type. The active objects for a meta-type can be accessed at any time using the Qtilities::Core::Interfaces::IObjectManager::metaTypeActiveObjects() function.

\section object_property_management Object Property Management

%Qtilities provided various features related to QObject property management. The sections that follow will provide highlights of these features.

\subsection object_property_management_working Working with object properties

To make working with object properties easier, %Qtilities comes with its own property classes which all inherit from Qtilities::Core::QtilitiesProperty. This approach provides many advantages
allowing you to control many aspects of the property. For example:
- QtilitiesProperty inherits from IExportable, thus you can define how properties must be exported.
- We can make interesting property types, for example Qtilities::Core::MultiContextProperty allows you to set a property on an object which has different values for different contexts. This is
used extensively in %Qtilities and is the foundation which allows objects to be attached to multiple observers at the same time.

The object manager provides many functions which helps you to work with properties on QObjects. QtilitiesProperty based classes are meant to compliment normal QVariant properties which can be set on QObjects and all the property functions provided by the object manager supports normal QVariant properties as well as
property classes inheriting from QtilitiesProperty.

Property related functionality on object manager includes:
- Cloning of properties between objects.
- Comparison of properties between objects.
- Exporting and importing of properties to and from both QDataStream and QDomDocument.
- Checking if properties exist.
- Easy set and get functions for QtilitiesProperty derived property classes.

See the static functions on Qtilities::Core::ObjectManager for more information.

\subsection object_property_management_displaying Displaying object properties

When %Qtilities is built using the \p QTILITIES_PROPERTY_BROWSER define enabled, the following widgets allows you to inspect properties on objects at runtime.

\subsubsection object_property_management_displaying_qproperties Displaying Q_PROPERTY properties

The Qtilities::CoreGui::ObjectPropertyBrowser allows you to inspect \p Q_PROPERTY properties on objects at runtime. The widget embedded in the debug plugin is shown below for an example object.

\image html debugging_static_properties.jpg "Static Properties Browser"

\subsubsection object_property_management_displaying_dynamic_properties Displaying dynamic properties

The Qtilities::CoreGui::DynamicObjectPropertyBrowser allows you to inspect dynamic properties on QObjects at runtime. This widget allows you to display the following
type of properties:
- Normal QVariant QObject properties set using setProperty() on any QObject.
- Qtilities::Core::SharedProperty properties.
- Qtilities::Core::MultiContextProperty properties. Note that the property values for all contexts are displayed as shown below.

The widget embedded in the debug plugin is shown below for an example object.

\image html debugging_dynamic_properties.jpg "Dynamic Properties Browser"


 */
